<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="dashboard/header :: header"></head>
<body>

<!--
@desc  添加
@author WeiXiaoJin
@since 2019-05-18 23:04:49
-->
	<div layout:fragment="content">
		<div class="container-fluid content-main">
			<div class="animated fadeIn">
				<div class="row">
					<!-- /.col-->
					<div class="col-sm-12">
						<div class="card">
							<div class="card-body">

								<form class="form-horizontal" id="addForm" style="float:left;width:100%">
								
									<input type="hidden" name="formToken" th:value="${session.formToken}" />

<div class="form-group row margin-right-0">
	<label class="col-md-2 col-form-label control-label" for="text-input">菜单名称</label>
	<div class="col-md-9">
		<input class="form-control" id="menusName" type="text" name="resourceName" placeholder="菜单名称">
	</div>
</div>

<!-- 
<div class="form-group row margin-right-0">
	<label class="col-md-2 col-form-label control-label" for="text-input">菜单图标</label>
	<div class="col-md-9">
		<input class="form-control" id="menusIcons" type="text" value="" name="resourceIcon" placeholder="菜单图标">
	</div>
</div>
-->

<div class="form-group">
	<label class="col-sm-2 control-label">图标：</label>
	<div class="col-sm-9" onclick="showFontIcons('resourceIcon','50')" >
		<input id="resourceIcon" name="resourceIcon" class="form-control" readonly="readonly" type="text" placeholder="选择图标">
		<input type="hidden" name="resourceIconLabel" id="resourceIconLabel" />	
	</div>
</div>

<div class="form-group row margin-right-0">
	<label class="col-md-2 col-form-label control-label" for="text-input">菜单链接</label>
	<div class="col-md-9">
		<input class="form-control" id="menusLink" type="text" name="resourceLink" placeholder="菜单链接">
	</div>
</div>

<!-- 
<div class="form-group row margin-right-0">
	<label class="col-md-2 col-form-label control-label" for="text-input">打开目标</label>
	<div class="col-md-9">
		<input class="form-control" id="openTarget" type="text" name="openTarget" placeholder="打开目标">
	</div>
</div>
<div class="form-group row margin-right-0">
	<label class="col-md-2 col-form-label control-label" for="text-input">是否主导航</label>
	<div class="col-md-9">
		<input class="form-control" id="hasNav" type="text" name="hasNav" placeholder="是否主导航">
	</div>
</div>
<div class="form-group row margin-right-0">
	<label class="col-md-2 col-form-label control-label" for="text-input">菜单类型规划状态</label>
	<div class="col-md-9">
		<input class="form-control" id="menusDesignStatus" type="text" name="menusDesignStatus" placeholder="菜单类型规划状态">
	</div>
</div>
-->

<div class="form-group row margin-right-0">
	<label class="col-md-2 col-form-label control-label" for="text-input">排序顺序</label>
	<div class="col-md-9">
		<input class="form-control" id="menusSort" type="text" name="resourceOrder" placeholder="排序顺序">
	</div>
</div>

<!-- 
<div class="form-group row margin-right-0">
	<label class="col-md-2 col-form-label control-label" for="text-input">所属类型</label>
	<div class="col-md-9">
		<input class="form-control" id="typeId" type="text" name="menuType" placeholder="所属类型">
	</div>
</div>
<div class="form-group row margin-right-0">
	<label class="col-md-2 col-form-label control-label" for="text-input">父类菜单</label>
	<div class="col-md-9">
		<input class="form-control" id="parentMenusId" type="text" name="resourceParent" placeholder="父类菜单">
	</div>
</div>
-->
							
								</form>
							</div>
<!-- 
							<div class="card-footer">
								<button class="btn btn-primary" style="float:right" onclick="save()" type="button">保存</button>
							</div>
 -->
						</div>
					</div>
					<!-- /.col-->
				</div>
			</div>
		</div>

	</div>

	<footer th:replace="dashboard/footer :: footer"></footer>
	<script type="text/javascript" th:src="@{/asserts/constom/js/common.js}"></script>

	<script type="text/javascript">
		var addForm = $("#addForm") ; 
		$(function(){
			addForm.validate({
				ignore: [],  
				rules: {
					resourceName: "required" ,
					resourceIcon: "required" ,
					resourceLink: "required" ,
					resourceOrder: {required:true , number:true}
				}
			});
		}) ;

		function submitHandler() {
			var result = $.validate.form("addForm");
			if(result){			
				$.operate.save(ctx+"basic/menus/save" , $('#addForm').serialize());
			}
	    }
		
	</script>

</body>
</html>

